# $Id$
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: Tobias Kieslich <tobias@archlinux.org>

pkgname=qjackctl
pkgver=0.4.4
pkgrel=1
pkgdesc="A Qt front-end for the JACK low-latency audio server"
url="http://qjackctl.sourceforge.net/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('jack' 'qt5-x11extras' 'hicolor-icon-theme')
makedepends=('qt5-tools')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
md5sums=('aa1a237103f5940b741c9b1580c105a5')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  # https://github.com/qbittorrent/qBittorrent/issues/5237
  # https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/Q5SWCUUMWQ4EMS7CU2CBOZHV3WZYOOTT/
  # http://pkgs.fedoraproject.org/cgit/rpms/qjackctl.git/commit/?id=c00a81a701e6d4a82aff6ae99ae7af3d162ca542
  # not so sure this is a proper fix, but seems to be the problem described -- schiv
  #sed -i.ac_with_paths -e "s|^ac_with_paths=.*|ac_with_paths=|g" configure
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  export ac_qmake=/usr/bin/qmake-qt5 \
         ac_moc=/usr/bin/moc-qt5 \
         ac_uic=/usr/bin/uic-qt5 \
         ac_lupdate=/usr/bin/lupdate-qt5 \
         ac_lrelease=/usr/bin/lrelease-qt5 \
         QMAKE=qmake-qt5


  ./configure --prefix=/usr
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
